from bigdata.labels import Hive_process

if __name__ == '__main__':
    hive = Hive_process.Hive_process()
    # 购买商品
    table_name = 'shopping.tbl_orders'
    orders_df = hive.read(table_name)
    goods_df = hive.read('shopping.tbl_goods')
    # goods_df.show()
    orders_df = orders_df.join(goods_df,orders_df['ordersn'] == goods_df['cordersn'])
    purchase_df = orders_df.select('productid','productname','memberId')
    purchase_df.show()